﻿@model List<DAL.Model.SunHotelsHotelEntities>
@using PagedList.Mvc;
<div class="row">
    <div class="col-lg-12">
        <h3 class="page-header"><i class="fa fa-laptop"></i>Hotele  w  wybranym kraju</h3>
        <ol class="breadcrumb">
            <li><i class="fa fa-home"></i><a href="@Url.Action("Index","Hotel")">Hotele</a></li>
            <li><i class="fa fa-laptop"></i>Lista hoteli</li>
        </ol>
    </div>
</div>
<div class="row">    
@using (Html.BeginForm("GetHotelByCountry", null, FormMethod.Post, new { @class = "formSearch", id = "search" }))
{
    <div class="searh-div col-lg-2">
        <button onclick="document.getElementById('search').submit();" class="hotel-details btn btn-primary">Szukaj w wybranym kraju</button>
    </div>
    <div class="searh-div col-lg-2">
        @Html.TextBox("SearchString", ViewBag.CurrentFilter as string, new { @class = "form-control", @style = "width:300px;", @placeholder = "Kraj" })
    </div>
}
    </div>
<section class="panel" style="margin-top: 20px;">
    <table class="table table-striped table-advance table-hover">
        <tbody>
            <tr>
                <th>Nazwa hotelu</th>
                <td>Typ</td>
                <th>Kraj</th>
                <th>Miasto</th>
                <th>Adres</th>
                <th>Kod pocztowy </th>
                @*<th></th>*@
            </tr>
            @foreach (var item in Model)
            {
                <tr>
                    <td>@item.Name</td>
                    <td>@item.AccomodationType</td>
                    <td>@item.Country</td>
                    <td>@item.City</td>
                    <td>@item.AddressStreet</td>
                    <td>@item.ZipCode</td>
                    @*<td>
                            <button class="hotel-details btn btn-primary" data-id="@item.SunHotelId">Szczegóły</button>
                        </td>*@
                </tr>
            }
        </tbody>
    </table>
</section>

<div id="hotel-details-wrapper"></div>

@*@section Scripts
{
    <script type="text/javascript">
        $(document).ready(function () {
            $('.hotel-details').live('click', function (e) {
                e.preventDefault();
                var id = $(this).attr('data-id');
                $.ajax({
                    url: '/Hotel/Details?token=' + id,
                    type: 'get',
                    success: function (result) {
                        $('#hotel-details-wrapper').html(result);

                        $('#hotel-modal').modal("show");
                    },
                    error: function (result) {

                    }
                });
            });
        });
    </script>
}*@
@*<div class="row">
    <div class="col-lg-12">
        <h3 class="page-header"><i class="fa fa-laptop"></i> Lista hoteli</h3>
        <ol class="breadcrumb">
            <li><i class="fa fa-home"></i><a href="index.html">Hotele</a></li>
            <li><i class="fa fa-laptop"></i>Lista hoteli według kraju</li>
        </ol>
    </div>
</div>
<section class="panel">

    <input type="text" name="DocumentNumber" style="width:99%;" id="DocumentNumbers" class="autocomplete"
           rel="@Url.Action("GetCountry", "Hotel")" data-placeholder="wyszukaj kraj" />
    <table class="table table-striped table-advance table-hover">
        <tbody>
            <tr>
                <th>
                    Full Name
                </th>
                <th>

                    Date
                </th>
                <th>

                    Email
                </th>
                <th>Nagłówek </th>
                <th>Nagłówek </th>
                <th>Akcje </th>
            </tr>
            <tr>
                <td>Angeline Mcclain</td>
                <td>2004-07-06</td>
                <td>dale@chief.info</td>
                <td>Rosser</td>
                <td>176-026-5992</td>
                <td>
            </tr>
            <tr>
                <td>Angeline Mcclain</td>
                <td>2004-07-06</td>
                <td>dale@chief.info</td>
                <td>Rosser</td>
                <td>176-026-5992</td>
                <td>
            </tr>
            <tr>
                <td>Angeline Mcclain</td>
                <td>2004-07-06</td>
                <td>dale@chief.info</td>
                <td>Rosser</td>
                <td>176-026-5992</td>
                <td>
            </tr>
            <tr>
                <td>Angeline Mcclain</td>
                <td>2004-07-06</td>
                <td>dale@chief.info</td>
                <td>Rosser</td>
                <td>176-026-5992</td>
                <td>
            </tr>
        </tbody>
    </table>
</section>

<script>
    $(document).ready(function () { $("#DocumentNumbers").select2(); });
</script>*@